package com.weixin.paleituo.activity;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.weixin.paleituo.R;
import com.weixin.paleituo.base.BasePersonActivity;
import com.weixin.paleituo.util.UIUtils;
import com.weixin.paleituo.view.BottomMenuDialog;

/**
 * Author yichao
 * Time  2017/12/13 9:18
 * Dest  补全个人资料
 */

public class CompletePersonInfoActivity extends BasePersonActivity {

    private View mContentView;
    private LinearLayout mLlSex;
    private BottomMenuDialog mBottomMenuDialog;
    private TextView mTvSexContent,mTvConfirm;

    @Override
    protected View getContentView(Context context) {

        mContentView = UIUtils.inflate(context, R.layout.activity_complete_personinfo);

        mLlSex = mContentView.findViewById(R.id.ll_sex_activity_complete_personinfo);
        mTvSexContent = mContentView.findViewById(R.id.tv_set_content_activity_complete_personinfo);
        mTvConfirm = mContentView.findViewById(R.id.tv_confirm_activity_complete_personinfo);

        return mContentView;
    }


    @Override
    protected void initData() {
        super.initData();
        mTvTitle.setText("填写个人信息");
    }

    @Override
    protected void initEvent() {
        super.initEvent();
        mLlSex.setOnClickListener(this);
        mTvConfirm.setOnClickListener(this);
    }

    public static void startActivity(Context context){

        Intent intent=new Intent(context,CompletePersonInfoActivity.class);
        context.startActivity(intent);
    }

    @Override
    public void onClick(View v) {
        super.onClick(v);
        switch (v.getId()){
            case R.id.ll_sex_activity_complete_personinfo:
                // .setTitle("更换封面")
                mBottomMenuDialog = new BottomMenuDialog.Builder(CompletePersonInfoActivity.this)
                        .setTitle("选择性别")
                        .addMenu("男", new View.OnClickListener() {
                            @Override
                            public void onClick(View v) {
                                mBottomMenuDialog.dismiss();

                                mTvSexContent.setText("男");
                            }
                        }).addMenu("女", new View.OnClickListener() {
                            @Override
                            public void onClick(View v) {
                                mBottomMenuDialog.dismiss();
                                mTvSexContent.setText("女");
                            }
                        }).create();

                mBottomMenuDialog.show();
                break;
                case R.id.tv_confirm_activity_complete_personinfo:
                 //   OrdersActivity.startActivity(this);
                    break;
        }
    }
}
